﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IDAL.Student;
using Model.Student;
using System.Web;

namespace SqliteDAL.Student
{
    public partial class SqliteStudent : IStudent
    {
        private static string datasource;

        public SqliteStudent()
        {
            //datasource = (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + @"\XmlFileStudent.xml")
            //    .Replace("\\", "/").Replace("file:/", "");
            datasource = HttpContext.Current.Server.MapPath("~/DB/Xml/XmlFileStudent.xml");
        }

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="obj">实体对象</param>
        /// <returns>新插入记录的编号</returns>
        public void Insert(StudentEntity obj)
        {
            try
            {

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="obj">实体对象</param>
        public void Update(StudentEntity obj)
        {

        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">记录编号</param>
        public void Delete(string id)
        {

        }

        /// <summary>
        /// 获得单个实体
        /// </summary>
        /// <param name="id">记录编号</param>
        /// <returns>实体对象</returns>
        public StudentEntity GetInfo(string id)
        {
            try
            {

            }
            catch (Exception ex)
            {
                throw ex;
            }


            StudentEntity entity = new StudentEntity();
            return entity;
        }

        /// <summary>
        /// 按指定条件获得记录数
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns>记录数</returns>
        public int GetCount(StudentEntity.SearchCondition condition)
        {
            return 0;
        }

        /// <summary>
        /// 按指定条件获得查询结果
        /// </summary>
        /// <param name="sql">sql语句</param> 
        /// <returns>实体集</returns>
        public List<StudentEntity> GetList(int startIndex, int endIndex, StudentEntity.SearchCondition condition)
        {
            List<StudentEntity> objlst = new List<StudentEntity>();
            return objlst;
        }
    }
}
